package edu.gatech.cs2340.teamrocket.model.pokemon.ailments;

import edu.gatech.cs2340.teamrocket.model.pokemon.Pokemon;

/**
 * Represents a Paralysis status ailment.
 *
 * @author Joe Tacheron
 */
public class Paralysis implements Ailment {

    private static double IMMOBILIZED_PROB = 0.25;

    /**
     * 25% chance this Pokemon will be unable to move.
     *
     * @param t
     * @return
     */
    @Override
    public String affect(Pokemon t) {
        if(Math.random() < IMMOBILIZED_PROB){
            t.canMove(false);
            return hurtMessage(t);
        }
        else{
            t.canMove(true);
            return null;
        }
    }

    @Override
    public String catchMessage(Pokemon t) {
        return t + " is now paralyzed!";
    }

    @Override
    public String healMessage(Pokemon t) {
        return t + " is no longer paralyzed!";
    }

    @Override
    public String faintMessage(Pokemon t) {
        throw new UnsupportedOperationException("Paralysis cannot cause a faint.");
    }

    @Override
    public String hurtMessage(Pokemon t) {
        return t + " is fully paralyzed!";
    }

    /**
     *
     * @return true
     */
    @Override
    public boolean healedByFullHeal() {
        return true;
    }

    /**
     *
     * @return "PAR" colored orange
     */
    @Override
    public String statusString() {
        return "<span color='#FFA500'>PAR</span>"; // orange
    }
}
